<html>
<head>
<title>Generate a checksum for a gadget ad</title>
<script src="http://www.google.com/ig/modules/filenewgadgets.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/codepress/codepress.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/codepress/codepress_wrapper.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/libhosting.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/staticvalidator.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/gge_content/messagecatalog.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/gge_content/adsnippet.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/gge_content/spreadsheetloader.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/gge_content/libclosure.js?ts=081108" type="text/javascript"></script>
  <script src="http://www.google.com/ig/modules/json.js?ts=081108" type="text/javascript"></script>
<script type="text/javascript" language="JavaScript">
var clicked = 0;
function checksum() {
  var str = document.getElementById("string").value;
  //remove leading and trailing white spaces.
  str = str.replace(/^\s+|\s+$/g, '');
  var checksum = _encodeString(str);
  output = document.getElementById("output")
  output.value = "<!-- {"+checksum+"} -->"+str;
  output.focus();
  output.select();
}
function select_all() {
  if (clicked == 0) {
    var text_val=document.getElementById("string");
    text_val.focus();
    text_val.select();
    clicked = 1;
  } else {
    return;
  }
}
</script>

</head>
<body>
This is a quick utility that I wrote to recompute the checksum of for a gadget ad tag.<br />
Sometimes it is necessary to adjust the gadget ad tag to add a user parameter or to<br />
insert a context macro for contextually aware gadgets.
<br /><br /><br />
<b>Step 1:</b>
Input the tag in the text area below. It should not include the original checksum like the example below.:<br />
  <textarea
    onClick="select_all();"
    rows="10"
    cols="80"
    id="string"><!-- {http://gadgetads.googlecode.com/svn/trunk/skeletons/single_flash.xml} -->
<iframe width="300" height="250" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" style="border:0px;padding:0px;margin:0px;overflow:hidden;" src="%%GADGET_RENDER_SERVICE%%?synd=ads&amp;url=http%3A%2F%2Fgadgetads.googlecode.com%2Fsvn%2Ftrunk%2Fskeletons%2Fsingle_flash.xml&amp;lang=%%LANG%%&amp;country=%%COUNTRY%%&amp;up_clickurl=%%CLICK_URL_ESC%%&amp;up_aiturl=%%AD_INT_URL_ESC%%&amp;up_ads_clicktarget_new_=%%TARGET_IN_NEW_WINDOW%%"></iframe></textarea>
<br /><br /><br />
<b>Step 2:</b>
Click on "<a href="#" onClick="checksum()">Get checksum</a>" to compute the checksum. The output will appear in the text area below.<br />
<br /><br /><br />
<b>Step 3:</b>
Cut and paste this into the 3rd party string in ICS.<br />
<textarea rows="10" cols="80" id="output">Output will appear here.</textarea>
<br /><br /><br />
<b>Notes:</b><br>
1. Leading and trailing white space is removed<br />
2. Because there is a newline in the gadget ad tag, a Mac, PC, and Linux will generate separate checksums.<br />
Checksums generated on one platform probably won't work on another platform.<br />

</body>
</html>